#!/bin/bash
#

sum=0
hangnum=$(sed -n '$=' /opt/test.2)
for i in $(seq $hangnum); do
    num=$(sed -n ${i}p /opt/test.2 | awk '{print $4}')
    sum=$((sum+num))
done

echo "办公人数总和：$sum"
